package demo1;

public class Text {
    public static void main(String[] args)throws CloneNotSupportedException {
        Person person=new Person();
        Person person2=(Person) person.clone();
    }
    public static void textException(int a){
        if(a==0){
            throw new ArithmeticException();
        }
    }
    public static void main3(String[] args) {
        int a=0;
        textException(a);
    }

    public static void main2(String[] args) {
        int[]arr=new int[]{1,2,3};
       try{
           System.out.println(arr[1]/0);

       }catch (NullPointerException e){
           System.out.println("处理NullPointerException");
           e.printStackTrace();
       }catch (ArithmeticException e){
           System.out.println("处理ArithmeticException");
           e.printStackTrace();
       } finally {
           System.out.println("hi");
       }
        System.out.println("hello");
    }
    public static void main1(String[] args) {
        int []arr=new int[]{1,2,3,4};
        System.out.println(10/0);
        System.out.println("after");
        System.out.println(arr[4]);

    }
}
